home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: peer-news.britain.eu.net!info!news
- From: Matthew Gibbons <m.h.gibbons@swansea.ac.uk>
- Subject: Division problem
- X-Nntp-Posting-Host: faith.swan.ac.uk
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <3141571F.41C67EA6@swansea.ac.uk>
- Sender: news@info.swan.ac.uk
- Content-Transfer-Encoding: 7bit
- Organization: Swansea News Server
- Mime-Version: 1.0
- Date: Sat, 9 Mar 1996 10:02:07 GMT
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3 sun4m)
-
- Hi,
-
- I have a little problem that I can't seem to solve. Any help would be
- greatly appreciated...
-
- I have a 64 bit number (grabbed from an external clock source) which
- I need to be able to divide by a given factor, replacing the original
- number with the quotient, and returning the remainder.
-
- The 64 bit number is of this type:
-
- typedef struct {
- unsigned char ssr[8];
- } gtime_t;
-
- The MSB of this number being ssr[7].
-
- I want to be able to call a function, say 'divgtime', thus:
-
- gtime_t gt;
- unsigned rem;
-
- :
-
- // divide the time by 1000
- rem = divgtime(>, 1000);
-
- :
-
- Where 1000 is the desired factor.
-
- I have tried lots of ways of doing this division, but to no avail.
-
- Can anyone help me? If you can, please could you email me, as my news
- link is very slow in updating.
-
- Thanks in advance,
- Matthew
-